from django.contrib import admin

# From NoPBX
from nopbx.infrastructure.models import Network, Location

###############################################################################

class NetworkAdmin(admin.ModelAdmin):
    """
    Basic Network administrative interface
    """
    list_display = ('name', 'cidr')

    fieldsets = [
        (None, {'fields': ['name', 'network', 'netmask', 'description']}),
    ]

admin.site.register(Network, NetworkAdmin)


###############################################################################

class LocationAdmin(admin.ModelAdmin):
    """
    Location administrative interface
    """
    list_display = ('name', 'context', 'description')

    fieldsets = [
        (None,                  {'fields': ['name', 'context', 'description']}),
        ('Network Information', {'fields': ['network']}),
    ]

admin.site.register(Location, LocationAdmin)

